@extends('home.public.master')
@section('content')
    <div class="main-container container">
        <ul class="breadcrumb">
            <li><a href="/"><i class="fa fa-home"></i></a></li>
            @if($classify->level==1)
                <li><a href="#">{{$classify->name}}</a></li>
                @endif
            @if($classify->level==2)
            <li><a href="#">{{$classify->classifyFather->name}}</a></li>
                <li><a href="#">{{$classify->name}}</a></li>
                @endif
            @if($classify->level==3)
                <li><a href="#">{{$classify->classifyFather->classifyFather->name}}</a></li>
                <li><a href="#">{{$classify->classifyFather->name}}</a></li>
                <li><a href="#">{{$classify->name}}</a></li>
            @endif
        </ul>

        <div class="row">

            <!--Middle Part Start-->
            <div id="content" class="col-md-9 col-sm-8">
                <div class="products-category">
                    <h3 class="title-category">精品推荐</h3>
                    <div class="category-desc">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="banners">
                                    <div>
                                        <a  href="#"><img src="{{asset('shop')}}/image/catalog/demo/category/img-cate.jpg" alt="img cate"><br></a>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                    <!-- Filters -->
                    <div class="product-filter product-filter-top filters-panel">
                        <div class="row">
                            <div class="col-md-5 col-sm-3 col-xs-12 view-mode">

                                <div class="list-view">
                                    <button class="btn btn-default grid active" data-view="grid" data-toggle="tooltip"  data-original-title="Grid"><i class="fa fa-th"></i></button>
                                    {{--<button class="btn btn-default list" data-view="list" data-toggle="tooltip" data-original-title="List"><i class="fa fa-th-list"></i></button>--}}
                                </div>

                            </div>
                            <div class="short-by-show form-inline text-right col-md-7 col-sm-9 col-xs-12">
                                <div class="form-group short-by">
                                    <label class="control-label" for="input-sort">排序:</label>
                                    <select id="input-sort" class="form-control"
                                            onchange="location = this.value;">
                                        <option value="" selected="selected">默认</option>
                                        <option value="">首字母(A - Z)</option>
                                        <option value="">首字母(Z - A)</option>
                                        <option value="">价格 (低 &gt; 高)</option>
                                        <option value="">价格 (高 &gt; 低)</option>
                                        <option value="">评分 (最高)</option>
                                        <option value="">评分 (最低)</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label class="control-label" for="input-limit">展示:</label>
                                    <select id="input-limit" class="form-control" onchange="location = '/list/{{$classify['id']}}/' + this.value">
                                        <option value="10" {{$num == 10 ? 'selected' : ''}}>10</option>
                                        <option value="20" {{$num == 20 ? 'selected' : ''}}>20</option>
                                        <option value="50" {{$num == 50 ? 'selected' : ''}}>50</option>
                                        <option value="75" {{$num == 75 ? 'selected' : ''}}>75</option>
                                        <option value="100" {{$num == 100 ? 'selected' : ''}}>100</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- //end Filters -->
                    <!--changed listings-->
                    <div class="products-list row nopadding-xs so-filter-gird">
                        {{--循环商品--}}
                        @foreach($goodList as $value)
                        <div class="product-layout col-lg-15 col-md-4 col-sm-6 col-xs-12 text-center">
                            <div class="product-item-container">
                                <div class="left-block left-b" style="width: 200px; height: 200px;">
                                    <div class="box-label">
                                        {{--<span class="label-product label-sale">-15%</span>--}}
                                    </div>
                                    <div class="product-image-container second_img text-center">
                                        <a style="width: 190px; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" href="{{route('showGoods',$value)}}" target="_self" title="{{$value->name}}" >
                                                <img src="{{$value->pictures[0]}}" class="img-1 img-responsive text-center" alt="image1">
                                                <img src="{{$value->pictures[0]}}" class="img-2 img-responsive" alt="image2">
                                        </a>

                                    </div>
                                    <!--quickview-->
                                    <div class="so-quickview">
                                        <a class="iframe-link btn-button quickview quickview_handler visible-lg" href="{{route('quickView',$value)}}" title="快速查看" data-fancybox-type="iframe"><i class="fa fa-eye"></i><span>快速查看</span></a>
                                    </div>
                                    <!--end quickview-->

                                </div>
                                <div class="right-block">
                                    <div class="button-group so-quickview cartinfo--left">
                                        <button type="button" class="addToCart" title="加入购物车" onclick="cart.add('60 ');">
                                            <span>加入购物车 </span>
                                        </button>
                                        <button type="button" class="wishlist btn-button" title="收藏" onclick="wishlist.add('60');"><i class="fa fa-heart-o"></i><span>收藏</span>
                                        </button>
                                        {{--<button type="button" class="compare btn-button" title="Compare this Product " onclick="compare.add('60');"><i class="fa fa-retweet"></i><span>查看商品</span>--}}
                                        {{--</button>--}}
                                    </div>
                                                        <div class="caption hide-cont">
                                                            <div class="ratings">
                                                                <div class="rating-box">    <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                                    <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                                    <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                                    <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                                    <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                                </div>
                                                                <span class="rating-num">( 3 )</span>
                                                            </div>
                                                            <h4 style="width: 190px; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
                                                                <a  href="{{route('showGoods',$value)}}" title="Pastrami bacon" target="_self">{{$value->name}}</a>
                                                            </h4>
                                                        </div>
                                                        <p class="price">
                                                            <span class="price-new">{{$value->price}}</span>
                                                            {{--<span class="price-old">$59.00</span>--}}
                                                        </p>
                                                        <div class="description item-desc">
                                                            <p>{{$value->brief}}</p>
                                                        </div>
                                                        <div class="list-block">
                                                            <button class="addToCart btn-button" type="button" title="加入购物车" onclick="cart.add('101', '1');"><i class="fa fa-shopping-basket"></i>
                                                            </button>
                                                            <button class="wishlist btn-button" type="button" title="收藏" onclick="wishlist.add('101');"><i class="fa fa-heart"></i></button>
                                                            {{--<button class="compare btn-button" type="button" title="Compare this Product" onclick="compare.add('101');"><i class="fa fa-refresh"></i>--}}
                                                            {{--</button>--}}
                                                            <!--quickview-->
                                                            <a class="iframe-link btn-button quickview quickview_handler visible-lg" href="{{route('quickView',$value)}}" title="快速查看" data-fancybox-type="iframe"><i class="fa fa-eye"></i></a>
                                                        </div>
                                </div>
                            </div>
                        </div>
                        @endforeach
                    </div>
                    <div class="product-filter product-filter-bottom filters-panel">
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">
                                {{$goodList->links()}}
                            </div>
                        </div>
                    </div>
                    <!-- //end Filters -->
                </div>
            </div>
            <!--Middle Part End-->

            <!--Right Part Start -->
            <aside class="col-sm-4 col-md-3 content-aside" id="column-left">

                <div class="module">
                    <h3 class="modtitle">筛选 </h3>
                    <div class="modcontent ">


                        <form class="type_2" action="{{route('list',$classify)}}" method="get">
                            <div class="table_layout filter-shopby">
                                <div class="table_row">
                                    <!-- - - - - - - - - - - - - - Category filter - - - - - - - - - - - - - - - - -->
                                    <div class="table_cell" style="z-index: 103;">
                                        <legend>属性筛选</legend>
                                    </div>
                                    {{--属性--}}
                                    @foreach($attributeArr as  $k => $item)
                                            <div class="table_cell">
                                                <fieldset>
                                                    <legend>{{$item->name}}</legend>
                                                    <ul class="checkboxes_list">
                                                        @foreach($item->attributeSon as $kk=> $value)
                                                            @if($kk<6)
                                                            <li>
                                                                <input type="radio" class="form-control" name="attribute[{{$k}}]" id="category_{{$value->id}}" value="{{$value->id}}" >
                                                                <label style="margin-top: 5px; line-height: 22px;" for="category_{{$value->id}}">{{$value->name}}</label>
                                                            </li>
                                                            @endif
                                                        @endforeach
                                                    </ul>
                                                </fieldset>
                                            </div>

                                    @endforeach
                                  {{--属性结束--}}
                                    <div class="table_cell">
                                        <fieldset>
                                            <legend>价格筛选</legend>
                                            <div class="range">
                                                范围 :
                                                <span class="min_val">¥0</span> -
                                                <span class="max_val">¥335.15</span>
                                                <input type="hidden" name="minprice" class="min_value" value="0">
                                                <input type="hidden" name="maxprice" class="max_value" value="335.15">
                                            </div>
                                            <div id="slider" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
                                                <div class="ui-slider-range ui-widget-header ui-corner-all"></div>
                                                <span class="ui-slider-handle ui-state-default ui-corner-all" ></span>
                                                <span class="ui-slider-handle ui-state-default ui-corner-all" ></span>
                                            </div>
                                        </fieldset>
                                    </div>
                                </div>
                                <footer class="bottom_box">
                                    <div class="buttons_row">
                                        <button type="submit" class="button_grey button_submit">搜索</button>
                                        <button type="reset" class="button_grey filter_reset">重置</button>
                                    </div>
                                    <div class="back-to-top"><i class="fa fa-angle-up"></i></div>
                                </footer>
                            </div>
                        </form>
                    </div>

                </div>

                <div class="module product-simple">
                    <h3 class="modtitle">
                        <span>新品</span>
                    </h3>
                    <div class="modcontent">
                        <div id="so_extra_slider_1" class="so-extraslider" >
                            <!-- Begin extraslider-inner -->
                            <div class="extraslider-inner">
                                <div class="item ">
                                    {{--新品循环--}}
                                    @foreach($newGood as $item)
                                    <div class="product-layout item-inner style1 ">
                                        <div class="item-image">
                                            <div class="item-img-info" >
                                                <a style="width: 100px; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" href="{{route('showGoods',$item)}}" target="_self" title="{{$item['name']}}">
                                                    <img src="{{$item->pictures[0]}}" alt="Mandouille short">
                                                </a>
                                            </div>

                                        </div>
                                        <div class="item-info">
                                            <div style="width: 150px; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" class="item-title">
                                                <a  href="{{route('showGoods',$item)}}" target="_self" title="{{$item['name']}}">{{$item['name']}} </a>
                                            </div>
                                            <div class="rating">
                                                <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i></span>
                                                <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
                                            </div>
                                            <div class="content_price price">
                                                <span class="price-new product-price">{{$item->price}} </span>&nbsp;&nbsp;
                                                <span class="price-old">{{$item['price']+mt_rand(10,60)}} </span>&nbsp;
                                            </div>
                                        </div>
                                    </div>
                               @endforeach
                                {{--新品循环结束--}}
                                </div>
                            </div>
                            <!--End extraslider-inner -->
                        </div>
                    </div>
                </div>

            </aside>
            <!--Right Part End -->
        </div>
        <!--Middle Part End-->
    </div>
    @endsection
@push('js')
    {{--选择属性做筛选--}}
    <script>




    </script>
    @endpush
